/*
 * @Author: chenhaoran
 * @Date: 2024-07-21 14:49:22
 * @LastEditors: chenhaoran
 * @LastEditTime: 2024-07-21 15:33:38
 */
import {
  defineStore
} from "pinia";
export const usePermissStore = defineStore('permiss', {
  state: () => {
    const defaultMenuList = {
      admin: ['0',
        '1',
        '11',
        '12',
        '13',
        '2',
        '21',
        '22',
        '23',
        '24',
        '25',
      ],
      user: ['0', '1', '11', '12', '13'],
    }
    const username = localStorage.getItem('token')?.userId
    return {
      key: username == 'admin' ? defaultMenuList.admin : defaultMenuList.user,
      defaultMenuList
    }
  },
  actions: {
    handleSet(val) {
      this.key = val
    }
  }
})